<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>公告管理</title>
    <style type="text/css">
      body {
  font-family: Arial, sans-serif;
  margin: 0;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

h1 {
  text-align: center;
}

form {
  margin-bottom: 20px;
}

form label {
  display: block;
  margin-bottom: 5px;
}

form input[type="text"],
form textarea {
  display: block;
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}

form button {
  display: block;
  margin: 10px 0;
  padding: 10px 20px;
  background-color: #4CAF50;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

ul {
  list-style: none;
  padding: 0;
}

li {
  padding: 10px;
  border: 1px solid #ccc;
  margin-bottom: 10px;
  border-radius: 5px;
  position: relative;
}

li button {
  position: absolute;
  right: 10px;
  top: 10px;
  background-color: #f44336;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fff;

     
    /* <link rel="stylesheet" href="gonggao.css"> */
    </style>
  </head>
  <body>
    <div class="container">
      <h1>公告管理</h1>
      <form>
        <h2>添加公告</h2>
        <label for="title">标题：</label>
        <input type="text" id="title" required>
        <label for="content">内容：</label>
        <textarea id="content" required></textarea>
        <button type="button" onclick="addNotice()">添加</button>
      </form>
      <hr>
      <h2>公告列表</h2>
      <ul id="notice-list"></ul>
    </div>
    <div class="modal">
      <div class="modal-content">
        <h2>编辑公告</h2>
        <form>
          <label for="edit-title">标题：</label>
          <input type="text" id="edit-title" required>
          <label for="edit-content">内容：</label>
          <textarea id="edit-content" required></textarea>
          <button type="button" onclick="saveNotice()">保存</button>
          <button type="button" onclick="closeModal()">取消</button>
        </form>
      </div>
    </div>
    <script src="script.js"></script>
  </body>
</html>
